<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>不区分大小写的正则表达式匹配</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.eregi-replace.html">eregi_replace</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.split.html">split</a></div>
 <div class="up"><a href="ref.regex.html">POSIX Regex 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.eregi" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">eregi</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">eregi</span> &mdash; <span class="dc-title">不区分大小写的正则表达式匹配</span></p>

 </div>
 <div class="refsect1 unknown-unknown-unknown-unknown-seealss" id="refsect1-function.eregi-unknown-unknown-unknown-unknown-seealss">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">int</span> <span class="methodname"><strong>eregi</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$pattern</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$string</code></span>
   [, <span class="methodparam"><span class="type">array</span> <code class="parameter reference">&$regs</code></span>
  ] )</div>

  <p class="para rdfs-comment">
   本函数和 <span class="function"><a href="function.ereg.html" class="function">ereg()</a></span>
   完全相同，只除了在匹配字母字符时忽略大小写的区别。
  </p>
  <p class="para">
   <div class="example" id="example-4714">
    <p><strong>Example #1 <span class="function"><strong>eregi()</strong></span> 例子</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$string&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'XYZ'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">eregi</span><span style="color: #007700">(</span><span style="color: #DD0000">'z'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$string</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"'</span><span style="color: #0000BB">$string</span><span style="color: #DD0000">'&nbsp;contains&nbsp;a&nbsp;'z'&nbsp;or&nbsp;'Z'!"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
  <p class="para">
   参见 <span class="function"><a href="function.ereg.html" class="function">ereg()</a></span>，<span class="function"><a href="function.ereg-replace.html" class="function">ereg_replace()</a></span>，<span class="function"><a href="function.eregi-replace.html" class="function">eregi_replace()</a></span>，<span class="function"><a href="function.stripos.html" class="function">stripos()</a></span>
   和 <span class="function"><a href="function.stristr.html" class="function">stristr()</a></span>。
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.eregi-replace.html">eregi_replace</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.split.html">split</a></div>
 <div class="up"><a href="ref.regex.html">POSIX Regex 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
